<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>移动端事件</title>
    <style>
        * {
            margin: 0;
            padding: 0;

        }

        #demo {
            width: 100%;
            height: 300px;
            background-color: skyblue;
        }
    </style>
</head>

<body>
    <div id="demo"></div>

    <script>

        const demo = document.getElementById('demo');

        demo.addEventListener('touchstart', () => {
            console.log('你开始摸我了');
        })

        demo.addEventListener('touchmove', () => {
            console.log('你在我身上移动呢');
        })

        demo.addEventListener('touchend', () => {
            console.log('你已经把手指拿走了');
        })

        demo.addEventListener('touchcancel', () => {
            console.log('被打断了');
        })


        setTimeout(() => {
            alert('电量不足')
        }, 3000);
    </script>
</body>

</html>